﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace SpaceGame.Scenes
{
    public class GameOverScene : DrawableGameComponent
    {
        private SpriteBatch m_SpriteBatch;
        private SpriteFont m_SpriteFont;

        public GameOverScene(Game game) : base(game)
        {
            m_SpriteBatch = new SpriteBatch(game.GraphicsDevice);
        }

        protected override void LoadContent()
        {
            m_SpriteFont = Game.Content.Load<SpriteFont>("Fonts/Tahoma32");
            base.LoadContent();
        }

        public override void Draw(GameTime gameTime)
        {
            Vector2 size = m_SpriteFont.MeasureString("OYUN BİTTİ");

            float dt = (float)gameTime.ElapsedGameTime.TotalMilliseconds;

            int drawX = (Game.GraphicsDevice.PresentationParameters.BackBufferWidth / 2) - ((int)size.X / 2);
            int drawY = (Game.GraphicsDevice.PresentationParameters.BackBufferHeight / 2) - ((int)size.Y / 2);

            m_SpriteBatch.Begin();

            m_SpriteBatch.DrawString(m_SpriteFont, "OYUN BİTTİ", new Vector2(drawX, drawY), Color.White);

            m_SpriteBatch.End();

            base.Draw(gameTime);
        }

    }
}
